//********************************************************************************************************
// Product Name: MapWindow.dll Alpha
// Description:  The core libraries for the MapWindow 6.0 project.
//
//********************************************************************************************************
// The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); 
// you may not use this file except in compliance with the License. You may obtain a copy of the License at 
// http://www.mozilla.org/MPL/ 
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 
// ANY KIND, either expressed or implied. See the License for the specificlanguage governing rights and 
// limitations under the License. 
//
// The Original Code is MapWindow.dll
//
// The Initial Developer of this Original Code is Ted Dunsford. Created in August, 2007.
// 
// Contributor(s): (Open source contributors should list themselves and their modifications here). 
//
//********************************************************************************************************
using System;
using System.Collections.Generic;
using System.Text;
using MapWindow.Main;
using MapWindow.Data;
using MapWindow.Geometries;
using MapWindow.Drawing;
using System.ComponentModel;
using System.Drawing;
namespace MapWindow.DirectX
{
    /// <summary>
    /// Constructor
    /// </summary>
    public interface ILayerCollectionDX : ILayerCollection
    {
 

        #region Methods

        /// <summary>
        /// This overload automatically constructs a new MapLayer from the specified
        /// feature layer with the default drawing characteristics and returns a valid
        /// IMapLayer which can be further cast into a PointLayer, MapLineLayer or
        /// a PolygonLayer, depending on the data that is passed in.
        /// </summary>
        /// <param name="layer">A pre-exsiting FeatureLayer that has already been created from a featureSet</param>
        void Add(ILayerDX layer);

        /// <summary>
        /// Adds the elements of the specified collection to the end of the System.Collections.Generic.List&lt;T&gt;
        /// </summary>
        /// <param name="collection">collection: The collection whose elements should be added to the end of the
        /// System.Collections.Generic.List&lt;T&gt;. The collection itself cannot be null, but it can contain elements that are null, 
        /// if type T is a reference type.</param>
        /// <exception cref="System.ApplicationException">Unable to add while the ReadOnly property is set to true.</exception>
        void AddRange(IEnumerable<ILayerDX> collection);


        /// <summary>
        /// Adds the specified filename to the map as a new layer.
        /// </summary>
        /// <param name="filename">The string filename to add as a layer.</param>
        /// <returns>An IMapLayer that is the layer handle for the specified file.</returns>
        ILayerDX Add(string filename);

        /// <summary>
        /// Adds the dataset specified to the file.  Depending on whether this is a featureSet,
        /// Raster, or ImageData, this will return the appropriate layer for the map.
        /// </summary>
        /// <param name="dataSet">A dataset</param>
        /// <returns>The IMapLayer to add</returns>
        ILayerDX Add(IDataSet dataSet);
        



        /// <summary>
        /// This overload automatically constructs a new MapLayer from the specified
        /// feature layer with the default drawing characteristics and returns a valid
        /// IMapLayer which can be further cast into a PointLayer, MapLineLayer or
        /// a PolygonLayer, depending on the data that is passed in.
        /// </summary>
        /// <param name="featureSet">Any valid IFeatureSet that does not yet have drawing characteristics</param>
        /// <returns>A newly created valid implementation of FeatureLayer which at least gives a few more common
        /// drawing related methods and can also be cast into the appropriate Point, Line or Polygon layer.</returns>
        IFeatureLayerDX Add(IFeatureSet featureSet);
        
        /// <summary>
        /// This overload automatically constructs a new MapLayer from the specified
        /// feature layer with the default drawing characteristics and returns a valid
        /// IMapLayer which can be further cast into a PointLayer, MapLineLayer or
        /// a PolygonLayer, depending on the data that is passed in.
        /// </summary>
        /// <param name="featureSet">Any valid IFeatureSet that does not yet have drawing characteristics</param>
        /// <param name="progressHandler">Any valid implementation of the IProgressHandler interface for progress messages</param>
        /// <returns>A newly created valid FeatureLayer which at least gives a few more common
        /// drawing related methods and can also be cast into the appropriate Point, Line or Polygon layer.</returns>
        IFeatureLayerDX Add(IFeatureSet featureSet, IProgressHandler progressHandler);

        /// <summary>
        /// Adds a new raster layer to the map, and returns the newly created layer as a RasterLayerDX.
        /// </summary>
        /// <param name="raster">The IRaster showing grid values that should be treated as 3D terrain.</param>
        /// <returns>The newly created RasterLayerDX that can render terrain in 3D</returns>
        RasterLayerDX Add(IRaster raster);

        /// <summary>
        /// Adds a enw raster layer to the map, and specifies a very specific texture to use
        /// instead of one generated from the cell values of the raster.
        /// </summary>
        /// <param name="raster">The raster to use</param>
        /// <param name="texture">The texture to drape on top of this raster image.</param>
        /// <returns>A new RasterLayerDX</returns>
        RasterLayerDX Add(IRaster raster, Image texture);

        /// <summary>
        /// Adds a enw raster layer to the map, and specifies a very specific texture to use
        /// instead of one generated from the cell values of the raster.
        /// </summary>
        /// <param name="raster">The raster to use</param>
        /// <param name="texture">The texture to drape on top of this raster image.</param>
        /// <param name="progressHandler">The progress handler for progress messages</param>
        /// <returns>A new RasterLayerDX</returns>
        RasterLayerDX Add(IRaster raster, Image texture, IProgressHandler progressHandler);
      
        /// <summary>
        /// Gets the number of members in this collection
        /// </summary>
        new int Count
        {
            get;
        }

        /// <summary>
        /// This simply tells the collection that the implicit this implementation should be the Layer version
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        new ILayerDX this[int index]
        {
            get;
            set;
        }
        
   
        /// <summary>
        /// Returns all the layers with point features in a list of PointLayers
        /// returns the values already cast as PointLayers.
        /// </summary>
        List<PointLayerDX> GetPointLayers();

        /// <summary>
        /// Returns the N'th PointLayer where N is the index where only point layers are counted
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        PointLayerDX GetPointLayer(int index);
        

         /// <summary>
        /// Returns a list of LineLayer interfaces representing each of the current MapLayers that happens
        /// to specifically be a LineStringLayer.  The index values will probably not match the index value in 
        /// the complete list of layers.
        /// </summary>
        List<LineLayerDX> GetLineStringLayers();
        
        /// <summary>
        /// Returns the N'th LineStringLayer where index is the index if only LineString layers are counted
        /// </summary>
        /// <param name="index">The integer index specifying the LineString Layer</param>
        /// <returns></returns>
        LineLayerDX GetLineStringLayer(int index);

        
        /// <summary>
        /// Returns a list of PolygonLayer interfaces representing each of the current MapLayers that happens
        /// to specifically be a LineStringLayer.  The index values will probably not match the index value in 
        /// the complete list of layers.
        /// </summary>
        List<PolygonLayerDX> GetPolygonLayers();
       

        /// <summary>
        /// Returns the N'th PolygonLayer where N is the index if only LineString layers are counted
        /// </summary>
        /// <param name="index">The integer index specifying the LineString Layer</param>
        /// <returns></returns>
        PolygonLayerDX GetPolygonLayer(int index);


        /// <summary>
        /// When you get an enumerator you get a layer enumerator implicitly
        /// </summary>
        /// <returns>An IEnumerator of the type ILayer</returns>
        new IEnumerator<ILayerDX> GetEnumerator();
        



        #endregion 

        #region Properties

        /// <summary>
        /// The envelope that contains all of the layers for this data frame.  Essentially this would be
        /// the extents to use if you want to zoom to the world view.
        /// </summary>
        IEnvelope Envelope
        {
            get;
        }

        /// <summary>
        /// Gets or sets the map frame that this belongs to.  These are designed to only work with one map frame at a time.
        /// </summary>
        new IMapFrameDX MapFrame
        {
            get;
            
        }

        /// <summary>
        /// Gets the total count of Point layers in this collection
        /// </summary>
        int NumPointLayers
        {
            get;
        }

        /// <summary>
        /// Gets the total count of LineString layers in this collection
        /// </summary>
        int NumLineLayers
        {
            get;
        }

        /// <summary>
        /// Gets the total count of Polygon layers in this collection
        /// </summary>
        int NumPolygonLayers
        {
            get;
        }

        ///// <summary>
        ///// Disposes any data
        ///// </summary>
        //new void Dispose();
        


        #endregion


    }
}
